Skip to content

refactor(xmss/prf): drop redundant message length check#741

Merged
tcoratger merged 1 commit into
leanEthereum:mainfrom
tcoratger:refactor/xmss-prf-len
May 21, 2026
Merged

refactor(xmss/prf): drop redundant message length check#741
tcoratger merged 1 commit into
leanEthereum:mainfrom
tcoratger:refactor/xmss-prf-len

Conversation

@tcoratger
Copy link
Copy Markdown
Collaborator

Summary

  • get_randomness takes message: Bytes32, which enforces a 32-byte payload at construction time.
  • MESSAGE_LENGTH is 32 in every production and test config, so the runtime len(message) != config.MESSAGE_LENGTH branch could never fire from the single internal call site (xmss/interface.py:285).
  • No test pinned the removed error message.

Test plan

  • uv run pytest tests/lean_spec/subspecs/xmss/ — 107 tests pass.

🤖 Generated with Claude Code

The parameter is typed Bytes32, which enforces a 32-byte payload
at construction. MESSAGE_LENGTH is also 32 in every prod and test
config, so the runtime length check could never fire from the
single internal call site. No test pinned the error message.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tcoratger tcoratger merged commit fdd4ab1 into leanEthereum:main May 21, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant